/*
 * stereocalib.h
 *
 *  Created on: Apr 15, 2013
 *      Author: rdu
 */

#ifndef STEREOCALIB_H_
#define STEREOCALIB_H_

#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"

#include <stdio.h>
#include <string.h>
#include <time.h>

#include <iostream>

using namespace cv;
using namespace std;

class StereoCalib
{
public:
	StereoCalib();
	~StereoCalib();

public:
	Size m_boardSize;
	float m_squareSize;
	float m_aspectRatio;
	string m_outputFilename;
	string m_inputFilename;
	bool m_displayCorners;

private:
	void CalcChessboardCorners(Size boardSize, float squareSize, vector<Point3f>& corners);
	bool Run2Calibration( vector<vector<Point2f> > imagePoints1,
	                            vector<vector<Point2f> > imagePoints2,
	                            Size imageSize, Size boardSize,
	                            float squareSize, float aspectRatio,
	                            int flags,
	                            Mat& cameraMatrix1, Mat& distCoeffs1,
	                            Mat& cameraMatrix2, Mat& distCoeffs2,
	                            Mat& R12, Mat& T12);
	bool ReadStringList( const string& filename, vector<string>& l );

public:
	int StereoCalibration();

};


#endif /* STEREOCALIB_H_ */
